import Vue from 'vue'
const skCommon = {
  state: {
    skStudentId:"",
    classList:[],
    relTenantIds:["10000000","88888888"],
    // relTenantIds:"10000000",
    columnsWidth:0
  },
  mutations: {
    setSkStudentId(state,id){
      state.skStudentId = id;
    },
    CLASS_LIST(state,list){
      state.classList = list;
    },
    CLOUMNS_WIDTH(state,length){
      if (length <= 5) {
        state.columnsWidth = 0
      }
      if (length > 5&&length <= 8) {
        state.columnsWidth = 2000
      }
      if (length > 8 && length <= 15) {
        state.columnsWidth = 2800
      }
      if (length > 15 && length <= 25) {
        state.columnsWidth = 6000
      }
      if (length > 25 ) {
        state.columnsWidth = 8000
      }
      console.log(state.columnsWidth);
    }
  },
  actions: {
    setClassList({commit},list){
      commit("CLASS_LIST",list)
    },
    setcolumnsWidth({commit},length){
      commit("CLOUMNS_WIDTH",length)
    }
  }
}
export default skCommon